package hhm.activeMQ.idontknow.mq;

import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;

public class MqClient {
	public Session getSession() {
		return session;
	}

	public void setSession(Session session) {
		this.session = session;
	}

	public MessageProducer getProducer() {
		return producer;
	}

	public void setProducer(MessageProducer producer) {
		this.producer = producer;
	}

	public MessageConsumer getConsumer() {
		return consumer;
	}

	public void setConsumer(MessageConsumer consumer) {
		this.consumer = consumer;
	}

	public Connection getConnection() {
		return connection;
	}

	public void setConnection(Connection connection) {
		this.connection = connection;
	}

	private Connection connection;
	private Session session;
	private MessageProducer producer;
	private MessageConsumer consumer;

	public void send(Message message) throws JMSException {
		producer.send(message);
	}

	public Message receive() throws JMSException {
		return consumer.receive();
	}

	public void start() throws JMSException {
		connection.start();
	}
}
